<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>jSocket Example</title>
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />    
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script src="../common/js/common.js" type="text/javascript"></script>
    <script src="http://swfobject.googlecode.com/svn/trunk/swfobject/src/swfobject.js" type="text/javascript"></script>
    <script src="../../../src/jsocket.js" type="text/javascript"></script>
    <script src="../../../src/jsocket.advanced.js" type="text/javascript"></script>
    
    <link rel="stylesheet" href="../common/css/style.css" type="text/css"/>
  </head>
  <body>
    <h1>jSocket example</h1>
    <div id="my_socket"></div>
    
    <script type="text/javascript">
     
      function ready()
      {
        console.log("socket ready");
        mySocket.connect("127.0.0.1", 80);
        
      }
      function connect(success,data)
      {
        console.log("socket connected");
        if(!success)
        {
          console.log("error:"+data)
          return;
        }
        mySocket.write("GET / HTTP/1.1\r\n\r\n");
        
      }
      
      function data(content)
      {
        console.log("socket data");
        console.log(content)
      
      }
      function close()
      {
        console.log("socket close");
      
      }    
    
      var mySocket = new jSocket(ready,connect,data,close);
      
      mySocket.setup("my_socket","../../../flash/jsocket.advanced.swf");    
    
    
    </script>
    
    
    
    
    <!-- Google Analytics Code, do not include in own implementation!-->
    <script type="text/javascript">
      var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
      document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
      try {
      var pageTracker = _gat._getTracker("UA-1139506-5");
      pageTracker._trackPageview();
      } catch(err) {}
    </script>
  </body>
</html>